<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>全文搜索</title>
<link href="../../../theme/style.css" rel="stylesheet" type="text/css" />
<script src="../../../theme/jquery.js" type="text/javascript"></script>
<script src="../../../theme/wscui.js" type="text/javascript"></script>
<script src="../../../theme/style.js" type="text/javascript"></script>
</head>
<body>
<div catalog-feed class="grammar">
	<h1>search</h1>
	<label class="format">
		<span class="t">mixed</span> <span class="t">array</span> <span class="f">search</span>(
			<span class="t">string</span> <span class="v">$param</span>
		)
	</label>
	<div class="intro">
		全文搜索时，
		系统自动按用户输入的文本进行最小分法处理(调用<a href="seg.html">seg</a>方法中的MIN控制)，
		同时，对最小分法后的词汇进行优化处理。
		<div class="br"></div>
		优化：例如最小(MIN)分词的结果为"中国"、"中国人"，
		系统将自动丢弃"中国"词汇，
		只返回"中国人"；<br />
		说明：当有多个词汇时，默认以权重(weight)基数由大到小(降序)返回
	</div>
	<div class="return">
		<div class="how">
			<pre><span class="t">return</span> <span class="t">array</span>(
	... 
	...
	<span class="t">array</span>(
		<span class="k">hash</span> 		=> <span class="s">1e24cf708a14ce81</span>, 		<span class="c">// 词汇MD5码的中间16个字符</span>
		<span class="k">times</span> 		=> <span class="i">3</span>, 						<span class="c">// 词频(在整个文档中出现次数)</span>
		<span class="k">weight</span> 	=> <span class="i">4.720000</span>, 				<span class="c">// 权重基数</span>
		<span class="k">word</span> 		=> <span class="s">测试</span>, 					<span class="c">// 词汇内容</span>
		<span class="k">length</span> 		=> <span class="i">2</span> 						<span class="c">// 词汇字数</span>
	), 
	... 
	...
);</pre>
		</div>
	</div>
	<div class="param">
		<h3>$param</h3>
		<ul>
			<li>
				<span show>string</span>
				<label>搜索内容</label>
				<div hide class="how">
					<span class="f">M</span>(<span class="s">cws</span>) -> <span class="f">search</span>(<span class="s">浙江卫视中国好舞蹈</span>);<br />
					<span class="c">// 返回：浙江卫视、中国好舞蹈</span><br />
					<span class="c">// 丢弃：浙江、卫视、中国、好舞蹈、舞蹈词汇</span><br />
					<span class="c">// 前提：浙江卫视、中国好舞蹈已在词典中</span>
				</div>
			</li>
		</ul>
	</div>
</div>
</body>
</html>

